﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestWpfPrism.Views
{
    public partial class FirstView : UserControl, IMainScreenItem
    {
        public FirstView()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var cgeo = new CombinedGeometry
            {
                GeometryCombineMode = GeometryCombineMode.Intersect,
                Geometry1 = new EllipseGeometry()
                {
                    RadiusX = pCircular.Width / 2,
                    RadiusY = pCircular.Height / 2,
                    Center = new Point(50, 50)
                },
                Geometry2 = new RectangleGeometry(new Rect(0, 0, 50, 50))
            };
            pPath.Data = cgeo;
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var contents = e.AddedItems.Cast<ListBoxItem>().Select(dd => dd.Content).ToArray();
            Trace.TraceInformation("ListBox_SelectionChanged.AddedItems " + String.Join(", ", contents));
        }
    }
}